From: Jonas Dreßler Date: Wed, 3 Jun 2020 16:07:01 +0000 (+0200) Subject: workspacesViews: Use translation for showing Workspaces X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~172 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b7db56ca9bd0ddeb19b9420f5ff7c25407377bef;p=gnome-shell.git workspacesViews: Use translation for showing Workspaces We're going to use fixed position for positioning workspaces when they're allocated by their own layout manager, using those positions to scroll between different workspaces interferes with that, so do that using translations instead. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1305 --- diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index 77524ed6b..591c2b46f 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -174,11 +174,11 @@ class WorkspacesView extends WorkspacesViewBase { let params = {}; if (workspaceManager.layout_rows == -1) - params.y = (w - active) * this._fullGeometry.height; + params.translation_y = (w - active) * this._fullGeometry.height; else if (this.text_direction == Clutter.TextDirection.RTL) - params.x = (active - w) * this._fullGeometry.width; + params.translation_x = (active - w) * this._fullGeometry.width; else - params.x = (w - active) * this._fullGeometry.width; + params.translation_x = (w - active) * this._fullGeometry.width; if (showAnimation) { let easeParams = Object.assign(params, { @@ -310,8 +310,8 @@ class WorkspacesView extends WorkspacesViewBase { let last = this._workspaces.length - 1; if (workspaceManager.layout_rows == -1) { - let firstWorkspaceY = this._workspaces[0].y; - let lastWorkspaceY = this._workspaces[last].y; + let firstWorkspaceY = this._workspaces[0].translation_y; + let lastWorkspaceY = this._workspaces[last].translation_y; let workspacesHeight = lastWorkspaceY - firstWorkspaceY; let currentY = firstWorkspaceY; @@ -321,11 +321,11 @@ class WorkspacesView extends WorkspacesViewBase { for (let i = 0; i < this._workspaces.length; i++) { this._workspaces[i].visible = Math.abs(i - adj.value) <= 1; - this._workspaces[i].y += dy; + this._workspaces[i].translation_y += dy; } } else { - let firstWorkspaceX = this._workspaces[0].x; - let lastWorkspaceX = this._workspaces[last].x; + let firstWorkspaceX = this._workspaces[0].translation_x; + let lastWorkspaceX = this._workspaces[last].translation_x; let workspacesWidth = lastWorkspaceX - firstWorkspaceX; let currentX = firstWorkspaceX; @@ -335,7 +335,7 @@ class WorkspacesView extends WorkspacesViewBase { for (let i = 0; i < this._workspaces.length; i++) { this._workspaces[i].visible = Math.abs(i - adj.value) <= 1; - this._workspaces[i].x += dx; + this._workspaces[i].translation_x += dx; } } }